<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // ES5继承（寄生组合继承）
    function Parent() {

    }
    function Child() {
      Parent.call(this)
    }

    Child.prototype = Object(Parent.prototype)
    Child.prototype.constructor = Child

    // ES6继承
    class Parent {
      constructor(name) {
        this.name = name

      }
    }
    class Child extends Parent {
      constructor(name, age) {
        this.age = age
        super(name)
      }
    }




  </script>
</body>

</html>